package cn.tedu.boyou.comment.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@ToString
@Document("answer_comment")
@AllArgsConstructor
@NoArgsConstructor
public class AnswerComment implements Serializable{

    //最热门的问答类型
    public static final int TYPE_HOT = 0;
    //最新的问答类型
    public static final int TYPE_NEWEST = 1;
    //待回答的类型
    public static final int TYPE_UNANSWERED = 2;
    //普通的评论
    public static final int STATE_COMMON = 0;
    //多个评论
    public static final int STATE_MANYCOMMON = 1;

    @Id
    private String id;  //id
    private String pid;
    private Long answerId;  //问题的id
    private String answerTitle; //问题的标题
    private Long userId;    //用户的id
    private String username;    //用户名
    private String city; //城市
    private int level;  //用户等级
    private String headUrl; //用户头像
    private int type = TYPE_HOT; //评论类别
    private Date createTime;    //评论时间
    private String content; //评论内容
    private AnswerComment refComment;   //关联的评论
    private int viewnum = 0; //阅读数
    private int replynum = 0;   //评论数
    private int thumbsupnum = 0; //点赞数
    private int state = STATE_COMMON; //评论转态
    private List<AnswerComment> answerComments = new ArrayList<>();
}
